package com.itheima.factory;

import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;

/**
 * @author by itheima
 * @Date 2022/4/21
 * @Description 定义实例工厂：调用静态方法生产对象的工厂叫做静态工厂
 */
public class InstanceFactory {

    /**
     * 通过静态方法构造对象
     * @return
     */
    public UserService createBean(){
        return new UserServiceImpl();
    }

//    public static void main(String[] args) {
//        InstanceFactory factory = new InstanceFactory();//被ioc容器管理
//        UserService bean = factory.createBean();//再调用
//        bean.save();
//    }


}
